/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nc.kyiv.yellow.sociallibrary.helper.web;

import java.util.Map;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author My
 */
public class CookieHelper {

    static final String LOGIN_KEY = "sllogin";
    static final String PASS_KEY = "slpass";
    static final String PASS_VALUE = "111";

    public static void createCookies(Map parsedData, HttpServletResponse response) {
        Cookie cookieLogin = new Cookie(LOGIN_KEY, (String) parsedData.get("uid"));
        cookieLogin.setMaxAge(14 * 24 * 60 * 60);
        Cookie cookiePass = new Cookie(PASS_KEY, PASS_VALUE);
        cookiePass.setMaxAge(14 * 24 * 60 * 60);
        response.addCookie(cookieLogin);
        response.addCookie(cookiePass);
    }
    
}
